import Vue from 'vue'
import Router from 'vue-router'
import Layout from '@/layout/index'

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    // {
    //   path: '/',
    //   //指定了相同的webpackChunkName，会合并打包成y一个js文件
    //   component: () =>
    //     import("@/views/index.vue"),
    // },
    {
      path: '/', //url路径
      component: Layout, // 此处不用动，这个全局统一的一个布局文件
      redirect: '/home',
      hidden: false,
      title: '主页',
      icon: 'el-icon-s-home',
      children: [{
        path: '/home', // 二级路径
        name: 'home',
        parentName: '主页',
        component: () => import("@/views/index.vue"),
        meta: {
          title: '测试',
          icon: 'el-icon-s-home' //配置选项可配置测试名称和图标
        }
      }]
    },
    {
      path: '/table',
      component: Layout,
      redirect: '/table/list',
      hidden: false,
      name: 'tableList',
      title:'表格管理',
      icon: 'el-icon-film',
      children: [{
        path: '/table/list',
        name: 'tableList',
        component: () => import('@/views/table'),
        parentName: '表格管理',
        meta: {
          title: '表格信息',
          icon: 'el-icon-film'
        }
      },{
        path: '/table/merge',
        name: 'tableMerge',
        component: () => import('@/views/table/tableMerge'),
        parentName: '表格合并',
        meta: {
          title: '表格合并',
          icon: 'el-icon-film'
        }
      },{
        path: '/table/cell',
        name: 'tableCell',
        component: () => import('@/views/table/tableCell'),
        parentName: '表格合并',
        meta: {
          title: '表格练习',
          icon: 'el-icon-film'
        }
      },{
        path: '/table/select',
        name: 'tableSelect',
        component: () => import('@/views/table/tableSelect'),
        parentName: '表格合并',
        meta: {
          title: '表格选中',
          icon: 'el-icon-film'
        }
      },{
        path: '/table/writeTable',
        name: 'tableWriteTable',
        component: () => import('@/views/table/tableWriteTable'),
        parentName: '表格合并',
        meta: {
          title: '手写表格',
          icon: 'el-icon-film'
        }
      },{
        path: '/table/input',
        name: 'tableInput',
        component: () => import('@/views/table/tableInput'),
        parentName: '表格合并',
        meta: {
          title: '表格输入',
          icon: 'el-icon-film'
        }
      }]
    },
    {
      path: '/form',
      component: Layout,
      redirect: '/form/cascadeForm',
      hidden: false,
      name: 'form',
      title:'表单管理',
      icon: 'el-icon-refrigerator',
      children: [{
        path: '/form/cascadeForm',
        name: 'formCascadeForm',
        component: () => import('@/views//form/cascadeForm'),
        parentName: '表单管理',
        meta: {
          title: '商品表单',
          icon: 'el-icon-refrigerator'
        }
      },{
        path: '/form/cascadeForm1',
        name: '/form/cascadeForm1',
        component: () => import('@/views//form/cascadeForm1'),
        parentName: '表单管理',
        meta: {
          title: '简单表单',
          icon: 'el-icon-refrigerator'
        }
      }]
    },
    {
      path: '/demo',
      component: Layout,
      redirect: '/demo/about',
      hidden: false,
      name: 'demoIndex',
      title:'功能测试',
      icon: 'el-icon-setting',
      children: [{
        path: '/demo/about',
        name: 'demoAbout',
        component: () => import('@/views/demo/about/about'),
        parentName: '功能测试',
        meta: {
          title: '关于我们',
          icon: 'list'
        }
      },{
        path: '/demo/polyv',
        name: 'demoPolyv',
        component: () => import('@/views/demo/polyv/polyv'),
        parentName: '功能测试',
        meta: {
          title: '视频上传',
          icon: 'list'
        }
      },{
        path: '/demo/vuex',
        name: 'demoVuex',
        parentName: '功能测试',
        meta: {
          title: 'Vuex',
          icon: 'list'
        },
        children: [{
          path: '/demo/vuex/productList', // 二级路径
          name: 'productList',
          parentName: 'demoVuex',
          component: () => import("@/views/demo/vuex/ProductList.vue"),
          meta: {
            title: '商品列表',
            icon: 'el-icon-s-home' //配置选项可配置测试名称和图标
          }
        },{
          path: '/demo/vuex/shoppingCart', // 二级路径
          name: 'shoppingCart',
          parentName: 'demoVuex',
          component: () => import("@/views/demo/vuex/ShoppingCart.vue"),
          meta: {
            title: '购物车',
            icon: 'el-icon-s-home' //配置选项可配置测试名称和图标
          }
        }]
      },{
        path: '/demo/tree',
        name: 'demoTree',
        component: () => import('@/views/demo/tree/tree'),
        parentName: '功能测试',
        meta: {
          title: 'Tree树',
          icon: 'list'
        }
      },{
        path: '/demo/slide',
        name: 'demoSlide',
        component: () => import('@/views/demo/tree/slide'),
        parentName: '功能测试',
        meta: {
          title: '轨迹进度条',
          icon: 'list'
        }
      },{
        path: '/demo/calendar',
        name: 'demoCalendar',
        component: () => import('@/views/demo/tree/calendar'),
        parentName: '功能测试',
        meta: {
          title: '工作日历',
          icon: 'list'
        }
      },{
        path: '/dataBoard',
        //指定了相同的webpackChunkName，会合并打包成y一个js文件
        component: () =>
          import("@/views/dataBoard/index.vue"),
      }
      ]
    },
    
    // {
    //   path: '/shoppingCart',
    //   //指定了相同的webpackChunkName，会合并打包成y一个js文件
    //   component: () =>
    //     import("@/views/ShoppingCart.vue"),
    // },
    // {
    //   path: '/product',
    //   //指定了相同的webpackChunkName，会合并打包成y一个js文件
    //   component: () =>
    //     import("@/views/ProductList.vue"),
    // },
    // {
    //   path: '/cascadeForm',
    //   //指定了相同的webpackChunkName，会合并打包成y一个js文件
    //   component: () =>
    //     import("@/views/cascadeForm.vue"),
    // },
    // {
    //   path: '/tableSelect',
    //   //指定了相同的webpackChunkName，会合并打包成y一个js文件
    //   component: () =>
    //     import("@/views/tableSelect.vue"),
    // },
    // {
    //   path: '/about',
    //   //指定了相同的webpackChunkName，会合并打包成y一个js文件
    //   component: () =>
    //     import("@/views/about.vue"),
    // },
    // {
    //   path: '/polyv',
    //   //指定了相同的webpackChunkName，会合并打包成y一个js文件
    //   component: () =>
    //     import("@/views/polyv.vue"),
    // },
    // {
    //   path: '/tree',
    //   //指定了相同的webpackChunkName，会合并打包成y一个js文件
    //   component: () =>
    //     import("@/views/tree.vue"),
    // },
    // {
    //   path: '/edit',
    //   //指定了相同的webpackChunkName，会合并打包成y一个js文件
    //   component: () =>
    //     import("@/views/edit.vue"),
    // },
    // {
    //   path: '/map',
    //   //指定了相同的webpackChunkName，会合并打包成y一个js文件
    //   component: () =>
    //     import("@/views/map.vue"),
    // },
    // {
    //   path: '/table',
    //   //指定了相同的webpackChunkName，会合并打包成y一个js文件
    //   component: () =>
    //     import("@/views/table.vue"),
    // },
    // {
    //   path: '/tableCell',
    //   //指定了相同的webpackChunkName，会合并打包成y一个js文件
    //   component: () =>
    //     import("@/views/tableCell.vue"),
    // },
    // {
    //   path: '/mergeTable',
    //   //指定了相同的webpackChunkName，会合并打包成y一个js文件
    //   component: () =>
    //     import("@/views/table/index.vue"),
    // },
    // {
    //   path: '/loadTable',
    //   //指定了相同的webpackChunkName，会合并打包成y一个js文件
    //   component: () =>
    //     import("@/views/table/loadTable.vue"),
    // },
    // {
    //   path: '/dataBoard',
    //   //指定了相同的webpackChunkName，会合并打包成y一个js文件
    //   component: () =>
    //     import("@/views/dataBoard/index.vue"),
    // },
    // {
    //   //商城相关目录
    //   path: '/mall',
    //   name: 'Mall',
    //   component: () => import("@/views/mall/index.vue"),
    //   redirect: '/mall/home',
    //   children: [{
    //     path: '/mall/home',
    //     name: 'Home',
    //     component: () => import("@/views/mall/home/index.vue"),
    //   }, {
    //     path: '/mall/goods',
    //     name: 'Goods',
    //     component: () => import("@/views/mall/goods/index.vue"),
    //   }, {
    //     path: '/mall/cart',
    //     name: 'Cart',
    //     component: () => import("@/views/mall/cart/index.vue"),
    //   }, {
    //     path: '/mall/my',
    //     name: 'My',
    //     component: () => import("@/views/mall/my/index.vue"),
    //   }]
    // }
  ]
})